#include"Line.h"

/////////////////
//include
/////////////////
#include"Triangle.h"

/////////////////
//prottype
/////////////////

/////////////////
//const
/////////////////


Line::Line(const Vector3D& start,	const Vector3D& end)
{
	this->start = start;
	this->end = end;
}
Line::~Line()
{
}

Vector3D Line::Collision(const Line&  Line)
{
	return Vector3D();
}
CollInfo Line::Collision(Triangle* tri)
{
	return tri->Collision(this);
}
CollInfo Line::Collision(CollisionObject* coll)	 
{
	return coll->Collision(this);
}
Box Line::GetBox()
{
	Box tmp_box = Box();
	tmp_box.center = start + GetVector()/2;
	tmp_box.size = Vector3D(abs(tmp_box.center.x - start.x)+0.01f,abs(tmp_box.center.y - start.y)+0.01f,abs(tmp_box.center.z - start.z)+0.01f);

	return tmp_box;
}
Sphere Line::GetSphere()
{
	Vector3D tmp_vec = GetVector();
	Sphere tmp_sphere = Sphere();
	tmp_sphere.center = start + tmp_vec/2;
	tmp_sphere.r = tmp_vec.Length()/2;
	return tmp_sphere;
}